home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / UTILREEN / EGA2RAM.LZH / EGA2RAM.DOC < prev    next >
Text File  |  1988-03-13  |  9KB  |  210 lines

  1.    Version 1.00           EGA²RAM        13 March 1988
  2.    ------------------------------------------------------------------
  3.  
  4.    EGA²RAM is yet another entry in my amazingly popular series of EGA
  5.    enhancement programs (I like them, anyway).    This particular program
  6.    was inspired by the recent announcements by Compaq, Quarterdeck and
  7.    others of so-called "shadow RAM" products.  Basically, the idea is to
  8.    copy the BIOS code from slow ROM to fast RAM.  Since most EGA cards
  9.    are designed to fit the least common denominator, i.e. 8-bit PC and
  10.    XT slots, one can achieve remarkable improvements in performance on
  11.    (16-bit) AT and (32-bit) 386 machines.  [It may be that performance
  12.    improves a little on plain-jane PCs, too, simply because the RAM is
  13.    slightly faster than ROM; I haven't tested this].
  14.  
  15.  
  16.  
  17.    HOW TO USE IT:
  18.    --------------
  19.  
  20.    EGA²RAM is written as a device driver and as such is loaded at boot
  21.    time by a statement in your CONFIG.SYS file:
  22.  
  23.            device = EGA2RAM.SYS     (assuming it's in your
  24.                           root directory)
  25.  
  26.    EGA²RAM should be loaded BEFORE any other drivers which mess with
  27.    the video routines, in particular ANSI.SYS and any Microsoft-compat-
  28.    ible mouse drivers.    If in doubt, just load EGA²RAM first; it will
  29.    create no compatibility problems that are not already present with
  30.    the EGA BIOS.  EGA²RAM uses 14,832 bytes of RAM (like all device
  31.    drivers, it is RAM-resident), and works only with IBM's EGA -- it
  32.    won't load unless it finds IBM's identification (read on for alter-
  33.    natives, though).
  34.  
  35.  
  36.  
  37.    HOW FAST IT IS:
  38.    ---------------
  39.  
  40.    I tested EGA²RAM on a 9 MHz IBM AT with IBM's EGA card (it had 128k
  41.    on it, but that shouldn't matter any).  I used PC Magazine's bench-
  42.    mark series (version 4.01), with the following results:
  43.  
  44.       TEST      REGULAR BIOS     EGA²RAM BIOS    % IMPROVEMENT IN SPEED
  45.       ----      ------------     ------------    ----------------------
  46.    No scrolling:    7.53 sec       3.90 sec          93%
  47.    Scrolling:       10.97 sec       7.27 sec          51%
  48.    Direct write:    7.90 sec       7.87 sec          .4%
  49.    Line pattern:   36.5  sec      19.4    sec          88%
  50.  
  51.    All times given are the average of three trials, and the last test
  52.    was timed using a stop watch (so is accurate to only +/- .1 sec).
  53.    Note that the direct write to display memory, since it bypasses the
  54.    BIOS completely, shows no improvement.  However, the other tests
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                  page 2
  65.  
  66.  
  67.    show a remarkable 50 to 100% improvement!!!    On a 32-bit 386 machine
  68.    the results should be even more striking (100 to 200%, I would guess).
  69.    I have (obviously) installed EGA²RAM on my system, and the speedup is
  70.    quite noticeable in ordinary DOS tasks such as directory listings
  71.    and so forth.  Programs such as Microsoft WORD and Borland's SIDEKICK
  72.    will not benefit much since they write directly to memory, but "well-
  73.    behaved" programs which use the BIOS interface for video things will
  74.    seem livelier.
  75.  
  76.  
  77.  
  78.    TECHNICAL DETAILS, ETC.
  79.    -----------------------
  80.  
  81.    First of all, EGA²RAM does NOT contain a copy of the EGA BIOS; it
  82.    simply copies what is already in your machine (so I'm not violating
  83.    any copyrights or anything).  Just copying the BIOS to RAM doesn't
  84.    get you anything, though; it is necessary to tell the machine to use
  85.    the RAM copy instead of the one in ROM.  This is where things begin
  86.    to get a bit complicated.  Clearly we must fix up the INT 10h video
  87.    interrupt; as it happens, the EGA also uses several others, namely
  88.    interrupts 1Fh, 42h, 43h, and 44h.  Of these latter four, however,
  89.    only 1Fh and 43h actually point to the EGA BIOS (at least in IBM's
  90.    version -- more on that later), so there are really only three in-
  91.    terrupts to re-vector.  In addition, there is a pointer in low memory
  92.    (address 0:04A8h) to a table in the BIOS which itself points to some
  93.    other tables in BIOS.  The latter tables initially contain only the
  94.    parameter settings for each EGA video mode, but they may be altered
  95.    by the user to also include custom font and palette information.
  96.    This is how programs such as KCSETPAL (Kent Cedola), SPECTRUM and
  97.    EGAITAL (PC Magazine), and WORD (Microsoft) work.  So actually there
  98.    are only two addresses to worry about besides the interrupts, the
  99.    one at 0:04A8h and the first entry in the table that is pointed at
  100.    by 0:04A8h.    (Confused yet?    Good.)
  101.  
  102.    The conclusions in the previous paragraph are only valid if two fur-
  103.    ther things hold:  (1) no other programs have fooled around with the
  104.    video interrupts/addresses before EGA²RAM, and (2) the EGA BIOS in
  105.    question is IBM's.  The first stipulation is obvious but not trivial:
  106.    clearly TSR programs ("pop-ups") such as SIDEKICK, SUPERKEY, and my
  107.    own EGA²LQ are likely culprits and should be loaded after EGA²RAM;
  108.    but what about device drivers which do the same thing?  ANSI.SYS is
  109.    a good candidate; but surprisingly enough, your mouse driver might
  110.    be just as guilty.  In particular, Microsoft's MOUSE.SYS and any
  111.    Microsoft-compatible drivers (e.g. Mouse Systems' MSMOUSE.SYS) also
  112.    hook into interrupt 10h, for reasons I won't go into here.  The upshot
  113.    of all this is that EGA²RAM cannot simply be loaded as an ordinary
  114.    TSR -- it has to be loaded *before* any other video-stealing routines,
  115.    which is why it is written as a device driver.
  116.  
  117.    The second stipulation, that the BIOS be IBM's, is perhaps not so
  118.    strict.  I think EGA²RAM is reasonably BIOS-independent, but since
  119.    I only have an IBM EGA with which to work, I couldn't check this.
  120.    For this reason I have included the source code to EGA²RAM.    Hardy
  121.    assembly language programmers can check their own interrupt table and
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                  page 3
  131.  
  132.  
  133.    BIOS to make sure there are no extra references to the C000h segment
  134.    where the EGA BIOS resides; if any are found, I expect it shouldn't
  135.    be too much trouble to change the program (I would appreciate hearing
  136.    about any such findings, though).  [You'll probably have to change
  137.    the number of bytes to transfer based on the length of your BIOS code
  138.    -- it shouldn't be more than 16k in any case.]  Or, if you feel a bit
  139.    daring (and don't mind the possibility of crashing up your machine),
  140.    you can just patch the driver with DEBUG or SYMDEB as follows:
  141.  
  142.        DEBUG EGA2RAM.SYS           (at the DOS prompt)
  143.        F 3B1B L2 EB 22           (at the DEBUG prompt, a dash (-))
  144.        N EGATEST.SYS           (name of the patched driver)
  145.        W                   (write it to disk)
  146.        Q                   (exit from DEBUG)
  147.  
  148.    Then load it in your CONFIG.SYS file as discussed above (device =
  149.    egatest.sys) and reboot your machine.  If it boots normally, fine!
  150.    You're all set.  If your display is blank or garbled, well, sorry,
  151.    your BIOS isn't that compatible.  And if you hear a high-pitched
  152.    squeal from your monitor or anything else unusual, TURN IT OFF IMMEDI-
  153.    ATELY!!!  [While there is almost no chance this will happen, it IS
  154.    possible to damage or destroy a color monitor by sending it monochrome
  155.    signals, or a mono monitor by sending color signals.  Any modifications
  156.    to EGA²RAM are at your own risk.  But speaking personally, I find the
  157.    risks are low enough that not only would I take the chance, I *have*
  158.    in the past (with my own equipment), and have never sustained any
  159.    damage of any sort, even when the above situation *did* occur....  Of
  160.    course, I turned the thing off pretty damn quick, too....]
  161.  
  162.    Lest any of the foregoing scare anyone off, let me emphasize that
  163.    the old video BIOS is still there regardless; the worst that is likely
  164.    to happen is that you will miss a pointer to something, so that part
  165.    of the time you are still using the (slower) ROM BIOS.  The actual
  166.    code is unchanged, however, so a slight decrease in performance is the
  167.    only penalty I can think of.
  168.  
  169.                -----------------------
  170.  
  171.    This program is free to all; the only thing I ask is that it not be
  172.    sold or used for any other commercial purpose, and that any modifications
  173.    that might be made are *specifically noted* in some form of documentation,
  174.    along with the name of whomever made the change.  (I, of course, will not
  175.    decline any recompense that might come my way, but there is absolutely no
  176.    obligation in this regard).
  177.  
  178.    Questions and comments are not only accepted but actively encouraged,
  179.    especially if you make the patch suggested above for non-IBM boards, and
  180.    it works.  Feel free to drop me a line at:
  181.  
  182.            Greg Roelofs
  183.            Amazingly Nifty Computer Stuff, Inc.
  184.            5433 S. Cornell Ave. #3N
  185.            Chicago, IL    60615
  186.  
  187.    Or, leave me a note on either the Chicago Computer Society BBS (312-942-
  188.    0706) or Loren Jones's Chicago Board (312-352-1035).
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                  page 4
  197.  
  198.  
  199.    And, by the way, my only connection with the University of Chicago is
  200.    that of graduate student; the University had nothing to do with this
  201.    program should not be considered particularly responsible for the way
  202.    it, or I, turned out.
  203.  
  204.  
  205.                -----------------------
  206.  
  207.  
  208.    EGA²RAM is provided as is; the user accepts any liability, etc., and
  209.    all that stuff.
  210.